#include "cf_includes.h"

CCF_Font::CCF_Font(void)
{
  this->m_height = 12;
  this->m_weight = FW_BOLD;
  this->m_faceName = L"Arial";
}

CCF_Font::~CCF_Font(void)
{
}

BOOL CCF_Font::Initialize( LPDIRECT3DDEVICE9 device )
{
  m_device = device;

  if( FAILED( D3DXCreateFont( m_device, this->m_height, 0, this->m_weight, 0, 
    FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, 
    DEFAULT_PITCH | FF_DONTCARE, m_faceName, &m_font )))
  {
    return false;
  }

  return true;
}

void CCF_Font::Draw( RECT rect, D3DCOLOR color, const WCHAR* text )
{
  m_font->DrawText(NULL, text, -1, &rect, 0, color );
}

void CCF_Font::Destroy()
{
  this->m_font->Release();
}
